class Solution(object):
    def findMaxConsecutiveOnes(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        max_count = 0
        n = len(nums)
        left_index = 0
        right_index = 0
        while right_index < n:
            if nums[right_index] == 1:
                max_count = max(max_count, right_index - left_index + 1)
            else:
                left_index = right_index + 1
            right_index += 1
        return max_count


data = Solution()
nums = [1, 1, 0, 1, 1, 1]
print(data.findMaxConsecutiveOnes(nums))